#region Copyright RenGuiYou. All rights reserved.
//=====================================================
// PandoraFrameWork
// Author:      RenGuiyou
// Feedback: 	mailto:750539605@qq.com
//=====================================================
#endregion

using UnityEngine;
using System.Collections.Generic;

public class AtlasConfig : ScriptableObject
{
    [System.Serializable]
    public struct PaddingItem
    {
        public string name;
        public Vector4 padding;
        public PaddingItem(string _name, Vector4 _padding) { name = _name; padding = _padding; }
    }

    [System.Serializable]
    public class AtlasItem
    {
        public string name;
        public List<PaddingItem> paddingList;
    }

    public List<AtlasItem> atlasList;

    public void AddAtlas(string _name, List<PaddingItem> paddingList)
    {
        atlasList ??= new List<AtlasItem>();
        foreach (var atlasItem in atlasList)
        {
            if (string.Equals(atlasItem.name, _name))
            {
                atlasItem.paddingList = paddingList;
                break;
            }
        }
        AtlasItem item = new AtlasItem();
        item.name = _name;
        item.paddingList = paddingList;
        atlasList.Add(item);
    }
}
